package top.byteio.common.mq.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import top.byteio.common.core.enums.OperationStatus;

import java.time.LocalDateTime;

/**
 *  MQ消息消费记录
* @author lerryxia
*/
@Data
@Builder
@EqualsAndHashCode
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "MQ消息DTO")
public class MqDTO<T> {
   /**
     * 消息唯一标识
     */
    @Schema(description = "消息唯一标识")
    @NonNull
    private String priKey;

    /**
     * 消息主题
     */
    @Schema(description = "消息主题")
    @NonNull
    private String topic;

    /**
     * 交换器
     */
    @Schema(description = "交换器")
    private String exchange;

    /**
     * 路由键
     */
    @Schema(description = "路由键")
    @NonNull
    private String routingKey;


    /**
     * 队列
     */
    @Schema(description = "队列")
    private String queue;

    /**
     * 内容
     */
    @Schema(description = "内容")
    private String content;

    /**
     * 状态：1.成功，0.失败
     * @see OperationStatus
     */
    @Schema(description = "状态：1.成功，0.失败")
    private OperationStatus status;

    /**
     * 错误信息
     */
    @Schema(description = "错误信息")
    private String errorMsg;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 重试次数
     */
    @Schema(description = "重试次数")
    private Integer retryCount;
}
